/*
 *  Copyright (C) 2021 张伊男
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#include "RuneParam.h"

RuneParam runeParam;

void RuneParam::LoadParam()
{
    cv::FileStorage fs("RuneParam.yml", cv::FileStorage::READ);
    fs["red_thresh"] >> runeParam.red_thresh;
    fs["blue_thresh"] >> runeParam.blue_thresh;
    fs["match_limit"] >> runeParam.match_limit;
    fs["maxHWRatio"] >> runeParam.maxHWRatio;
    fs["minHWRatio"] >> runeParam.minHWRatio;
    fs["maxArea"] >> runeParam.maxArea;
    fs["minArea"] >> runeParam.minArea;
    fs["R_max_area"] >> runeParam.R_max_area;
    fs["R_min_area"] >> runeParam.R_min_area;
    fs["R_max_ratio"] >> runeParam.R_max_ratio;
    fs["R_min_ratio"] >> runeParam.R_min_ratio;
    fs["shanye_min_area"] >> runeParam.shanye_min_area;
    fs["delay_time"] >> runeParam.delay_time;

    fs.release();
}
